Include undelete link in Monobook skin
authorBrion Vibber <brion@users.mediawiki.org>
Tue, 1 Jun 2004 03:41:00 +0000 (03:41 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Tue, 1 Jun 2004 03:41:00 +0000 (03:41 +0000)
includes/Skin.php
includes/SkinPHPTal.php
templates/xhtml_slim.pt

index be19c19..095c10f 100644 (file)
@@ -496,17 +496,27 @@ class Skin {
                                $s.=" | <strong>". wfMsg( "newmessages", $tl ) . "</strong>";
                        }
                }
-               if( $wgUser->isSysop() &&
-                               (($wgTitle->getArticleId() == 0) || ($action == "history")) &&
-                               ($n = $wgTitle->isDeleted() ) ) {
-                       $s .= " | " . wfMsg( "thisisdeleted",
-                                       $this->makeKnownLink(
-                                               $wgLang->SpecialPage( "Undelete/" . $wgTitle->getPrefixedDBkey() ),
-                                               wfMsg( "restorelink", $n ) ) );
+               
+               $undelete = $this->getUndeleteLink();
+               if( !empty( $undelete ) ) {
+                       $s .= " | $undelete";
                }
                return $s;
        }
 
+       function getUndeleteLink() {
+               global $wgUser, $wgTitle, $wgLang, $action;
+               if( $wgUser->isSysop() &&
+                       (($wgTitle->getArticleId() == 0) || ($action == "history")) &&
+                       ($n = $wgTitle->isDeleted() ) ) {
+                       return wfMsg( "thisisdeleted",
+                               $this->makeKnownLink(
+                                       $wgLang->SpecialPage( "Undelete/" . $wgTitle->getPrefixedDBkey() ),
+                                       wfMsg( "restorelink", $n ) ) );
+               }
+               return "";
+       }
+       
        function printableLink()
        {
                global $wgOut, $wgFeedClasses, $wgRequest;
index 3ce8d22..b28a744 100644 (file)
                                '<span class="subpages">'.$subpagestr.'</span>'.$out->getSubtitle():
                                $out->getSubtitle()  
                        );
+                       $undelete = $this->getUndeleteLink();
+                       $tpl->set(
+                               "undelete", !empty($undelete)?
+                               '<span class="subpages">'.$undelete.'</span>':
+                               ''
+                       );
+
                        $tpl->set( 'catlinks', $this->getCategories());
                        if( $wgOut->isSyndicated() ) {
                                $feeds = array();
index 6062192..293002b 100644 (file)
@@ -29,6 +29,7 @@
            <div tal:condition="catlinks" id="catlinks" tal:content="structure catlinks"></div>
            <h3 id="siteSub" i18n:translate="string:fromwikipedia">From Wikipedia, the free encyclopedia.</h3>
            <div id="contentSub" tal:content="structure subtitle"></div>
+           <div id="contentSub" tal:condition="undelete" tal:content="structure undelete"></div>
            <div id="siteNotice" tal:condition="sitenotice" tal:content="structure sitenotice"></div>
            <!-- <esi:include src="userxy/message"/> cached per user, purged on new message-->
            <div tal:condition="newtalk" class="usermessage" tal:content="structure newtalk"></div>